import request from '@/utils/request'

export function page(query) {
  return request({
    url: '/api/admin/firetask/page',
    method: 'get',
    params: query
  })
}

export function addPlace(Obj) {
  return request({
    url: '/api/admin/firetask',
    method: 'post',
    data: Obj
  })
}

export function addTaskList(Obj) {
  return request({
    url: '/api/admin/firetask/addTaskList',
    method: 'post',
    data: Obj
  })
}

export function updateStatus(id) {
  return request({
    url: '/api/admin/firetask/updateStatus/' + id,
    method: 'put'
  })
}

export function taskListDetails(Obj) {
  return request({
    url: '/api/admin/firetask/taskListDetails',
    method: 'get',
    params: Obj
  })
}

export function getPlace(id) {
  return request({
    url: '/api/admin/firetask/' + id,
    method: 'get'
  })
}

export function upObj(id, obj) {
  return request({
    url: '/api/admin/firetask/' + id,
    method: 'put',
    data: obj
  })
}

export function deleteTask(id) {
  return request({
    url: '/api/admin/firetask/deleteStatus/' + id,
    method: 'delete'
  })
}

export function fireBuildsDelete(id) {
  return request({
    url: '/api/admin/fireBuilding/' + id,
    method: 'delete'
  })
}

// 任务列表
export function taskList(query) {
  return request({
    url: '/api/admin/firetask/taskList',
    method: 'get',
    params: query
  })
}

// 建筑条件查询
export function taskLsitBuilds(task) {
  return request({
    url: '/api/admin/fireTenement/taskLsitBuilds',
    method: 'post',
    data: task
  })
}

// PC端查询任务进度
export function taskProgress(query) {
  return request({
    url: '/api/admin/firetask/taskProgress',
    method: 'get',
    params: query
  })
}

// pc下发通知书
export function sendNote(tenementId) {
  return request({
    url: '/api/admin/fireBuilding/sendNote',
    method: 'get',
    params: { tenementId }
  })
}

// 查找社区
export function findCommunitysInTask(streetId) {
  return request({
    url: '/api/admin/region/findCommunitysInTask',
    method: 'get',
    params: { streetId }
  })
}

// 查询监理人
export function getSupervisoryList(params) {
  return request({
    url: '/api/admin/supervision/supervisionUserList',
    method: 'GET',
    params
  })
}

// 监理任务
export function getSupervisoryTask(params) {
  return request({
    url: '/api/admin/supervision/supervisionList',
    method: 'GET',
    params
  })
}

// 需要监理的商户列表
export function getSupervisoryTenement(params) {
  return request({
    url: '/api/admin/supervision/fireSupervisionTenement',
    method: 'GET',
    params
  })
}

// 新增监理任务
export function addSupervisoryTask(data) {
  return request({
    url: '/api/admin/supervision/addSupervisionTask',
    method: 'POST',
    data
  })
}

// 下发监理任务
export function updateSupervisoryTask(id) {
  return request({
    url: `/api/admin/supervision/addSupervisionTask/${id}`,
    method: 'PUT'
  })
}

// 获取监理子任务列表
export function getSupervisoryChild(params) {
  return request({
    url: '/api/admin/supervision/querySupervisionTaskList',
    method: 'GET',
    params
  })
}

// 获取监理子任务列表
export function deleteSupervisoryChild(id) {
  return request({
    url: `/api/admin/supervision/delSupervisionTask/${id}`,
    method: 'DELETE'
  })
}

export function taskChecker(id) {
  return request({
    url: '/api/admin/firetask/taskChecker/' + id,
    method: 'get'
  })
}

export function addTaskChecker(data) {
  return request({
    url: '/api/admin/firetask/addTaskChecker',
    method: 'put',
    data
  })
}

export function deleteTaskList(taskId) {
  return request({
    url: '/api/admin/firetask/deleteTaskList/' + taskId,
    method: 'DELETE'
  })
}

export function issueAllTasks(Obj) {
  return request({
    url: '/api/admin/firetask/issueAllTasks',
    method: 'post',
    data: Obj
  })
}

export function addSubtask(taskId, tenementList) {
  return request({
    url: '/api/admin/firetask/addSubtask/' + taskId,
    method: 'post',
    data: tenementList
  })
}

export function rejectedTrialTask(tenementId) {
  return request({
    url: '/api/admin/firetask/rejectedTrial',
    method: 'put',
    params: { tenementId }
  })
}

export function rejectedPreTrialTask(tenementId) {
  return request({
    url: '/api/admin/firetask/rejectedPreTrial',
    method: 'put',
    params: { tenementId }
  })
}

export function taskInspector(id) {
  return request({
    url: '/api/admin/supervision/taskInspector/' + id,
    method: 'get'
  })
}

export function addTaskInspector(data) {
  return request({
    url: '/api/admin/supervision/addTaskInspector',
    method: 'put',
    data
  })
}

export function deleteSupervisionTask(taskId) {
  return request({
    url: '/api/admin/supervision/deleteSupervisionTask/' + taskId,
    method: 'delete'
  })
}

export function addsupervisionSubtask(taskId, tenementList) {
  return request({
    url: '/api/admin/supervision/addedTasks/' + taskId,
    method: 'post',
    data: tenementList
  })
}

export function issueAllSupervisionTasks(Obj) {
  return request({
    url: '/api/admin/supervision/issueAllSupervisionTasks',
    method: 'post',
    data: Obj
  })
}
